package com.bitBusy.manageyourriches.database.contactClasses;

import java.util.List;

import android.content.Context;

import com.bitBusy.manageyourriches.database.managers.DatabaseInteractor;


public class SpendingSubcategory{

	private String name;
	private String parent_category;
	private int myImageID;
	
	/**expenses*/
	private List<ExpenseDetails> myExpenses;
	
	
	public SpendingSubcategory(String the_name, String the_parent_category, int the_imageID)
	{
		name = the_name;
		parent_category = the_parent_category;
		myImageID = the_imageID;
	}
	
	public String getName()
	{
		return name;
	}
	
	public String getParentCategory()
	{
		return parent_category;
	}
	
	public int getImageID()
	{
		return myImageID;
	}
	
	public List<ExpenseDetails> getExpenses(Context the_context, int the_fromDate, int the_toDate) {
		
		if (myExpenses == null && the_context != null)
		{
			myExpenses = new DatabaseInteractor(the_context).getExpenses(parent_category, name, the_fromDate,  the_toDate);
		}
		return myExpenses;
		
	}
			
}
